import Vue from 'vue'
import VueRouter from 'vue-router'
import Register from '../views/Register.vue'
import HomeView from '../views/HomeView.vue'
import Login from '../views/Login.vue'
import SpuDetail from '../views/SpuDetail.vue'
import Cart from '../views/Cart.vue'
import Address from '../views/Address.vue'
import Account from '../views/Account.vue'
import OrderList from '../views/OrderList.vue'
import SpuList from '../views/SpuList.vue'
Vue.use(VueRouter)

const routes = [{
    path: '/regist',
    name: 'register',
    component: Register
  },
  {
    path: '/',
    name: 'home',
    component: HomeView
  },
  {
    path: '/login',
    name: 'login',
    component: Login
  },
  {
    path: '/spuDetail',
    name: 'spuDetail',
    component: SpuDetail
  },
  {
    path: '/cart',
    name: 'cart',
    component: Cart
  },
  {
    path: '/address',
    name: 'address',
    component: Address
  },
  {
    path: '/account',
    name: 'account',
    component: Account
  },
  {
    path: '/orderlist',
    name: 'orderlist',
    component: OrderList
  },
  {
    path: '/spulist',
    name: 'spulist',
    component: SpuList
  }
]

const router = new VueRouter({
  mode: 'history',
  routes
})

export default router
